<template>
  <div class="card-wrap">
    <div class="inner">
      <div class="image-wrap">
        <div class="prompt">崭新出厂</div>
        <ScaleImage
          class="scale-image"
          scaleHeight="74%"
          :imgUrl="cardData.imageUrl"
        />
      </div>
      <div class="name">{{ cardData.name }}</div>
      <div class="price">
        <i class="icon iconfont icon-meiyuan"></i>
        <span class="price-text">{{ cardData.price }}</span>
      </div>
    </div>
  </div>
</template>

<script>
import ScaleImage from 'common/scale-image/scale-image.vue'
export default {
  name: 'goods-card',
  props: {
    cardData: {
      type: Object,
      default: () => { }
    },
  },
  components: {
    ScaleImage
  }
}
</script>

<style lang="less" scoped>
.card-wrap {
  display: block;
  padding: 8px;
  box-sizing: border-box;

  .inner {
    width: 100%;
    display: block;
    // display: flex;
    // flex-direction: column;
    border-radius: 5px;
    background-color: #24252f;
    overflow: hidden;

    .image-wrap {
      position: relative;

      border-bottom: 2px solid #adc8cb;
      background-image: url(https://21skins.com/static/media/item-bg.da989999.jpg);
      background-size: 100% 100%;

      .prompt {
        z-index: 2;
        position: absolute;
        top: 0;
        left: 0;
        width: min-content;
        white-space: nowrap;
        padding: 0 8px;
        font-size: 12px;
        height: 20px;
        line-height: 20px;
        color: rgb(2, 191, 77);
        background-color: rgba(0, 0, 0, 0.6);
      }

      .scale-image {
        margin: 0 auto;
        width: 87.7%;
        border: none;
        background: none;
      }
    }

    .name {
      margin-top: 16px;
      padding-left: 8px;
      box-sizing: border-box;
      height: 21px;
      line-height: 21px;
      font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
      font-weight: 500;
      color: #c3c3e2;
      width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .price {
      margin-top: 4px;
      padding-left: 8px;
      padding-bottom: 8px;

      box-sizing: border-box;
      display: flex;
      align-items: center;
      height: 27px;
      color: rgb(233, 177, 14);

      .icon {
        height: 14px;
        width: 14px;
        font-size: 14px;
        color: rgb(233, 177, 14);
      }

      .price-text {
        display: inline-block;
        padding-left: 10px;
        height: 16px;
        line-height: 16px;
        font-size: 16px;
        color: rgb(233, 177, 14);
      }
    }
  }
}
</style>